{include file="public/header" /}
<body class="bgc">
<div class="header">
    <span class="layui-icon layui-icon-left"  onclick="history.go(-1)"></span> 商家订单
</div>

<ul class="pro-list-nav">
    <li data-type="" class="{if !$Request.param.type}active{/if}">
        <div>全部</div>
        <p></p>
    </li>
    <li data-type="2" class="{if $Request.param.type == 2}active{/if}">
        <div>待发货</div>
        <p></p>
    </li>
    <li data-type="3" class="{if $Request.param.type == 3}active{/if}">
        <div>待收货</div>
        <p></p>
    </li>
    <li data-type="4" class="{if $Request.param.type == 4}active{/if}">
        <div>已完成</div>
        <p></p>
    </li>
</ul>

<ul class="my-order-list tpl_list">

</ul>
<script id="template" type="text/html">

    {{# for(var i=0;i < d.data.length ;i++){ }}
    <li>
        <div class="flex-layout">订单编号：
            <div class="{{d.data[i].sn}}">{{d.data[i].sn}}</div>
            <span>{{d.data[i].status}}</span>
        </div>
        <a href="{:url('merchant/my_order_details')}?id={{d.data[i].id}}">
            <ul class="submit-pro-list">
                {{# for(var j=0;j < d.data[i].productsField.length;j++){ }}
                <li>
                    <p class="flex-center">
                        <img src="{{d.data[i].productsField[j].icon}}" alt="">
                    </p>
                    <div class="center">
                        <p class="multi">{{d.data[i].productsField[j].title}}</p>
                         <p class="spec">{{d.data[i].productsField[j].spec}}</p>
                    </div>
                    <div class="rgt">
                        <p class="price">￥<span>{{d.data[i].productsField[j].vip_price}}</span></p>
                        <p>x{{d.data[i].productsField[j].num}}</p>
                    </div>
                </li>
                {{# } }}
            </ul>
        </a>
        <p class="order-price">实付款<span>￥{{d.data[i].real_amount}}</span></p>
        <div class="order-btn">
            {{# if(d.data[i].statusCode == 2) { }}
            <a onclick="load_href('{:url(\'merchant/deliver_order_details\')}?id={{d.data[i].id}}',2)" class="bc">发货</a>
            {{# } }}

        </div>
    </li>
    {{# } }}

</script>
</body>
{include file="public/footer"/}
<script>
    $(function () {
        getFlow('{$Request.param.type?:""}', "{:url('merchant/getOrderList')}");

        $('.pro-list-nav li').click(function () {
            $(".tpl_list").empty();
            getFlow($(this).attr('data-type'), "{:url('merchant/getOrderList')}");
            $(this).addClass('active').siblings().removeClass('active')
        });
    })
</script>
</html>